<%--
  Created by IntelliJ IDEA.
  User: limin
  Date: 2021/8/10
  Time: 22:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="com.dao.MemberDao" %>
<%@ page import="com.beans.MemberInfo" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE HTML>
<html>
<head>
    <base href="<%=basePath%>">

    <title></title>

    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">

    <link rel="stylesheet" type="text/css" href="css/edittable.css">
    <link rel="stylesheet" type="text/css" href="css/validate.css">
    <link rel="stylesheet" type="text/css" href="css/maintable.css">
    <script type="text/javascript" src="js/jquery-1.8.0.js"></script>
    <script>
        $(function(){
            $("input[type=text],textarea").focus(function(){
                $(this).addClass("input_focus");
            }).blur(function(){
                $(this).removeClass("input_focus");
            });

            $(".form_btn").hover(function(){
                    $(this).css("color","red").css("background","#6FB2DB");
                },

                function(){
                    $(this).css("color","#295568").css("background","#BAD9E3");
                });
        });
    </script>
    <style>
        label {
            display: block;
            margin-top: 4px;
            color: red;
        }

        .td_input {
            width: 230px;
        }
    </style>
</head>
<%
    MemberDao memberDao = new MemberDao();
    int id = Integer.parseInt(request.getParameter("id"));
    MemberInfo memberInfo = memberDao.getMemberInfoById(id);
    String[] ip = memberInfo.getIp().split(",");
    request.setAttribute("memberInfo", memberInfo);
    request.setAttribute("ip", ip);
%>
<body>
<div class="div_title">
    <div class="div_titlename"><img src="images/san_jiao.gif"><span>会员详细信息</span></div>
</div>

<table class="edit_table">
    <tr>
        <td class="td_info">会员账号：</td>
        <td class="td_input">
            <label class="txtbox">${memberInfo.memberNo}</label>
        </td>
        <td class="td_info">会员姓名：</td>
        <td class="td_input">
            <label class="txtbox">${memberInfo.memberName}</label>
        </td>
    </tr>
    <tr>
        <td class="td_info">联系电话：</td>
        <td class="td_input">
            <label class="txtbox">${memberInfo.phone}</label>
        </td>
        <td class="td_info">电子邮箱：</td>
        <td class="td_input">
            <label class="txtbox">${memberInfo.email}</label>
        </td>
    </tr>
    <tr>
        <td class="td_info">注册日期：</td>
        <td class="td_input">
            <label class="txtbox">${memberInfo.registerDate}</label>
        </td>
        <td class="td_info">身份证号：</td>
        <td class="td_input">
            <label class="txtbox">${memberInfo.idCard}</label>
        </td>
    </tr>
    <tr>
        <td class="td_info">登录次数：</td>
        <td class="td_input">
            <label class="txtbox">${memberInfo.loginCounts}</label>
        </td>
        <td class="td_info">最后登录时间：</td>
        <td class="td_input">
            <label class="txtbox">${memberInfo.lastLoginDate}</label>
        </td>
    </tr>
    <tr>
        <td class="td_info">会员常用ip：</td>
        <td class="td_input">
            <c:forEach var="ip" items="${ip}">
                <label class="txtbox">${ip}</label>
            </c:forEach>
        </td>
        <td class="td_info">会员等级：</td>
        <td class="td_input">
            <label class="txtbox">${memberInfo.memberLevel}</label>
        </td>
    </tr>
    <tr>
        <td class="td_info"></td>
        <td class="td_input">
            <button class="form_btn" onclick="window.history.back()">返回</button>
        </td>
        <td class="td_input"></td>
        <td></td>
    </tr>
</table>
</body>
</html>
